#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath> 
using namespace std;

class Solution {
public:
    double myPow(double x, int n) {
        double result = 1;
        if(n==0){
            result = 1;
        }
        else if(n>0){
            result = func(x,n,0);
        }
        else{
            if(n==-1*pow(2,31)){
                double temp = (-1.0)*n;
                result = 1/func(x,temp-1,1);
            }
            else{
                result = 1/func(x,-n,0);
            }
        }
        return result;

    }
    //使用快速幂计算x的n次幂
    double func(double x, int n,int status){

        double value;
        if(status==0){
            value = 1;
        }
        else{
            value = x;
        }
        while(n>=1){
            if(n%2!=0){
                value *= x;
            }
            x = x*x;
            n = n/2;
        }
        return value;
    }
};

int main(){
    Solution S;
    cout<<S.myPow(2,-2147483648)<<endl;
    // cout<<pow(2,31)<<endl;
}
